/**
 * nuordered_map容器封装了哈希表
 * .size()--返回元素个数
 * .empty()--判断哈希表是否为空
 * .clear()--清空哈希表
*/
#include <iostream>
#include <unordered_map>
using namespace std;
template<class K,class V>
using umap=std::unordered_map<K,V>;//对nuordered_map进行重命名
class person{
public:
    int age;
    string name;
    person(int age_m,string name_m):age(age_m),name(name_m){}
};
template<typename T>
void print(T t){
    for(auto val:t){
        cout<<val.first<<" "<<val.second.age<<" "<<val.second.name<<endl;
    }
}
int main()
{
    umap<int,person> u1;
    u1.emplace(2,person(1,"a"));
    u1.emplace(3,person(1,"b"));
    u1.emplace(4,person(1,"c"));
    u1.emplace(5,person(1,"d"));
    u1.emplace(8,person(1,"e"));
    u1.emplace(26,person(1,"f"));
    u1.emplace(27,person(1,"g"));
    u1.emplace(29,person(1,"h"));
    cout<<u1.size()<<endl;
    auto a=u1.find(3);
    for(umap<int,person>::iterator it=u1.begin();it!=u1.end();it++){
        if(it->first == a->first){
            cout<<it->first<<endl;
        }
    }
    return 0;
}